package com.company.clientscard.server.service;

import com.google.web.bindery.requestfactory.shared.ServiceLocator;

public class DaoLocator implements ServiceLocator {

	public Object getInstance(Class<?> clazz) {
		// return new ClientController();
		try {
			return clazz.newInstance();
		} catch (InstantiationException e) {
			throw new RuntimeException(e);
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		}

		// HttpServletRequest request = RequestFactoryServlet
		// .getThreadLocalRequest();
		//
		// ServletContext servletContext = request.getSession()
		// .getServletContext();
		//
		// ApplicationContext context = WebApplicationContextUtils
		// .getWebApplicationContext(servletContext);
		//
		// return context.getBean(clazz);
	}
}
